home *** CD-ROM | disk | FTP | other *** search
/ Collection of Internet / Collection of Internet.iso / faq / comp / x_faq / part2 < prev    next >
Text File  |  1994-03-04  |  44KB  |  879 lines

  1. Newsgroups: comp.windows.x,news.answers,comp.answers
  2. Path: bloom-beacon.mit.edu!hookup!swrinde!cs.utexas.edu!uunet!visual!dbl
  3. From: dbl@visual.com (David B. Lewis)
  4. Subject: comp.windows.x Frequently Asked Questions (FAQ) 2/6
  5. Message-ID: <CM59Hr.A2D@visual.com>
  6. Followup-To: poster
  7. Summary: useful information about the X Window System
  8. Reply-To: faq%craft@uunet.uu.net (X FAQ maintenance address)
  9. Organization: VISUAL, Inc.
  10. Date: Fri, 4 Mar 1994 14:27:27 GMT
  11. Approved: news-answers-request@MIT.Edu
  12. Expires: Sun, 3 Apr 1994 00:00:00 GMT
  13. Lines: 863
  14. Xref: bloom-beacon.mit.edu comp.windows.x:22113 news.answers:16015 comp.answers:4032
  15.  
  16. Archive-name: x-faq/part2
  17. Last-modified: 1994/03/03
  18.  
  19. ----------------------------------------------------------------------
  20. Subject:  16)  Why does my X session exit when I kill my window manager (sic)?
  21.  
  22.     It needn't.  What is probably happening is that you are running your
  23. window manager as the last job in your .xsession or .xinitrc file; your X
  24. session runs only as long as the last job is running, and so killing your
  25. window manager is equivalent to logging out. Instead, run the window manager
  26. in the background, and as the last job instead invoke something safe like:
  27.         exec xterm -name Login -rv -iconic
  28. or any special client of your devising which exits on some user action.  Your
  29. X session will continue until you explicitly logout of this window, whether or
  30. not you kill or restart your window manager.
  31.     Alternatively, there is a chance that you are using OpenLook, which by
  32. default kills all clients on logging out. Change your Exit menu choice from
  33. EXIT to WMEXIT to correct this behavior.
  34.  
  35. ----------------------------------------------------------------------
  36. Subject:  17)  Can I save the state of my X session, like toolplaces does?
  37.  
  38.     Although no known window manager directly supports such a feature
  39. (olvwm and swm may come close) -- which may be equivalent to writing out a
  40. .xinitrc or .xsession file naming the geometry and WM_COMMAND of each
  41. application  -- there is a contributed application which does much of what
  42. you are looking for, although it is not as complete as the SunView program
  43. toolplaces.  Look for the application "xplaces" on an archive-server near
  44. you.  There are several versions of this program floating around; look for a
  45. recent vintage.  [10/90]
  46.     Some new pseudo session-managers such as HP's vuewm provide for the
  47. saving of sessions including information on the geometry of currently-running
  48. applications and the resource database.  [Bjxrn Stabell
  49. (bjoerns@staff.cs.uit.no); 3/93.]
  50.  
  51. ----------------------------------------------------------------------
  52. Subject:  18)  How do I use another window manager with DEC's session manager?
  53.  
  54.     DEC's session manager will start dxwm up by default. To override this,
  55.     add to your .Xdefaults file something like this line, naming the full
  56. pathname:
  57.     sm.windowManagerName:   /wherever/usr/bin/X11/your_favorite_wm
  58.  
  59. ----------------------------------------------------------------------
  60. Subject:  19)! How do I change the keyboard auto-repeat rate?
  61.  
  62.     You can turn auto-repeat on or off by using "xset r on|off". 
  63.  
  64.     The base X11 protocol, doesn't provide for varying the auto-repeat
  65. rate, which is a capability not supported by all systems.
  66.     Some pre-R6 servers may provide command-line flags to set the rate at
  67. start-up time. If you have control over server start-up (see the man pages
  68. for xinit and xdm), you can invoke the server with the chosen settings; for
  69. example, you can start the R5 Xsun sample server with the options "-ar1 350
  70. -ar2 30" to reduce the sensitivity of the keyboard.
  71.  
  72.     The R6 X Keyboard Extension provides a vendor-independent way to
  73. control repeat delay and rate.
  74.  
  75. ----------------------------------------------------------------------
  76. Subject:  20)  How do I remap the keys on my keyboard to produce a string?
  77.  
  78.     There is no method of arranging for a particular string to be produced
  79. when you press a particular key. The xmodmap client, which is useful for
  80. moving your CTRL and ESC keys to useful places, just rearranges keys and does
  81. not do "macro expansion."
  82.     Some (few) clients, including xterm and several X-based editors,
  83. accept a translation resource such as:
  84.     xterm*VT100.Translations: #override \
  85.         <Key>F1: string("setenv DISPLAY unix:0")
  86. which permits the shorthand F1 to be pressed to reset the display locally
  87. within an xterm; it takes effect for new xterm clients. To include control
  88. characters in the string, use \nnn, where nnn is the octal encoding of the
  89. control character you want to include.
  90.     Window managers, which could provide this facility, do not yet; nor
  91. has a special "remapper" client been made available.
  92.  
  93. ----------------------------------------------------------------------
  94. Subject:  21)  How do I make a screendump or print my application (including menus)?
  95.  
  96.     The xwd client in the X11 distributions can be used to select a window
  97. or the background. It produces an XWD-format file of the image of that
  98. window.  The file can be post-processed into something useful or printed with
  99. the xpr client and your local printing mechanism. To print a screendump
  100. including a menu or other object which has grabbed the pointer, you can use
  101. this command:
  102.         csh% sleep 10; xwd -root > output.xwd &
  103. and then spend 10 seconds or so setting up your screen; the entire current
  104. display will be saved into the file output.xwd. Note that xwd also has an
  105. undocumented (before R5) -id flag for specifying the window id on the
  106. command-line. [There are also unofficial patches on ftp.x.org to xwd for
  107. specifying the delay and the portion of the screen to capture.]
  108.  
  109.     Two publicly-available programs which allow interactive definition of
  110. arbitrary portions of the display and built-in delays are asnap and xgrabsc.
  111. There are several versions of xgrabsc; version 2.3, available on ftp.x.org
  112. [9/93] is the most recent. xgrab, part of the package, is an interactive
  113. front-end to xgrabsc.
  114.     xsnap includes some asnap features and supersedes it; it also renders
  115. XPM output [version unknown]. It is available on ftp.x.org or avahi.inria.fr;
  116. see xsnap-pl2.tar.Z.
  117.     A screen-dump and merge/edit program combining features of xwd and xpr
  118. is available from vernam.cs.uwm.edu as xdump1.0.tar.Z.  Information:
  119. soft-eng@cs.uwm.edu.
  120.     xprint, by Alberto Accomazzi (alberto@cfa.harvard.edu) is available
  121. from cfa0.harvard.edu (128.103.40.1) as /pub/wipl/xprint.export-2.1.tar.Z.
  122. The package allows users to create encapsulated color PostScript files which
  123. will print on any PostScript Level-1 compliant printer (black and white or
  124. color).
  125.  
  126.     To post-process the xwd output of some of these tools, you can use
  127. xpr, which is part of the X11 distribution. Also on several archives are
  128. xwd2ps and XtoPS, which produce Encapsulated PostScript with trimmings
  129. suitable for use in presentations (see ftp.x.org:contrib/xwd2ps.tar.Z and
  130. contrib/ImageMagick2.3.4.2.tar.Z). Also useful is the PBMPLUS/Netpbm package 
  131. on many archive servers; and the Xim package contains Level 2 color PostScript 
  132. output.
  133.  
  134.     The XV program can grab a portion of the X display, manipulate it, and
  135. save it in one of the available formats. ImageMagick has similar
  136. capabilities.
  137.  
  138.     Also:
  139.  
  140.     Bristol Technology (info@bristol.com, 203-438-6969) offers Xprinter
  141. 2.0, an Xlib API for PostScript and PCL printers; a demo is on ftp.uu.net in
  142. vendor/Bristol/Xprinter.
  143.  
  144.     ColorSoft 9619-459-8500) offers OPENprint package includes a screen-
  145. capture facility, image-processing, and support for PostScript and
  146. non-PostScript printers.
  147.  
  148.     Some vendors' implementations of X (e.g. DECWindows and OpenWindows)
  149. include session managers or other desktop programs which include "print
  150. portion of screen" or "take a snapshot" options. Some platforms also have
  151. tools which can be used to grab the frame-buffer directly; the Sun systems,
  152. for example, have a 'screendump' program which produces a Sun raster file.
  153. Some X terminals have local screen-dump utilities to write PostScript to a
  154. local serial printer.
  155.  
  156.     Some vendors' implementations of lpr (e.g. Sony) include direct
  157. support for printing xwd files, but you'll typically need some other package
  158. to massage the output into a useful format which you can get to the printer.
  159.  
  160. ----------------------------------------------------------------------
  161. Subject:  22)  How do I make a color PostScript screendump of the X display?
  162.  
  163.     If you need color PostScript in particular, you can 
  164.     - grab the screen-image using a program which can produce color 
  165. PostScript, such as xgrabsc, xprint, and xv
  166.     - grab the screen-image using xwd and post-process xwd into color PS.
  167.     You can do this using xwd2ps or the XtoPS program from the ImageMagick
  168. distribution. The PBMPLUS/Netpbm package is also good for this, as is the Xim
  169. package.
  170.  
  171. ----------------------------------------------------------------------
  172. Subject:  23)  How do I make a screendump including the X cursor?
  173.  
  174.     This can't be done unless the X server has been extended. Consider
  175. instead a system-dependent mechanism for, e.g.,  capturing the frame-buffer.
  176.  
  177. ----------------------------------------------------------------------
  178. Subject:  24)  How do I convert or view Mac/TIFF/GIF/Sun/PICT/img/FAX images in X?
  179.  
  180.     The likeliest program is an incarnation of Jef Poskanzer's useful++
  181. Portable Bitmap Toolkit, which includes a number of programs for converting
  182. among various image formats. It includes support for many types of bitmaps,
  183. gray-scale images, and full-color images. PBMPLUS has been updated recently;
  184. the most recent version [12/91] is on ftp.x.org in
  185. contrib/pbmplus10dec91.tar.Z.
  186.     
  187.     Netpbm is based on the PBMPLUS 10dec91 release, with many additions
  188. and improvements. It is intended to be portable to many platforms while 
  189. allowing for conversion of images between a variety of formats. The latest
  190. sources are on several sites, including wuarchive.wustl.edu (128.252.135.4)
  191. and peipa.essex.ac.uk (155.245.115.161). Contact oliver@fysik4.kth.se to be
  192. added to the netpbm mailing list.
  193.  
  194.     Another tool is San Diego Supercomputing Center's IMtools ('imconv' in
  195. particular), which packages the functionality of PBM into a single binary.
  196. It's available anonymous ftp from sdsc.edu (132.249.20.22).
  197.  
  198.     Useful for viewing and converting some image-formats is Jim Frost's
  199. xloadimage; the most recent [11/93] is on ftp.x.org in
  200. contrib/xloadimage.4.1.tar.Z.  Graeme Gill's updates to an earlier version of
  201. xloadimage are also on ftp.x.org; see xli.README and xli.tar.Z.uu; version
  202. 1.15 was released 7/93.
  203.  
  204.     xv (X Image Viewer), written by bradley@cis.upenn.edu (John Bradley),
  205. can read and display pictures in Sun Raster, PGM, PBM, PPM, X11 bitmap, TIFF,
  206. GIF and JPEG. It can manipulate on the images: adjust, color, intensity,
  207. contrast, aspect ratio, crop). It can save images in all of the aforementioned
  208. formats plus PostScript. It can grab a portion of the X display, manipulate on
  209. it, and save it in one of the available formats. The program was updated 5/92;
  210. see the file contrib/xv-2.21.tar.Z on ftp.x.org.  Version 3.00 [5/93] is
  211. distributed as shareware.
  212.  
  213.     The Fuzzy Pixmap Manipulation, by Michael Mauldin
  214. (mlm@nl.cs.cmu.edu).  Conversion and manipulation package, similar to
  215. PBMPLUS.  Version 1.0 available via FTP as
  216. nl.cs.cmu.edu:/usr/mlm/ftp/fbm.tar.Z, uunet.uu.net:pub/fbm.tar.Z, and
  217. ucsd.edu:graphics/fbm.tar.Z.
  218.  
  219.     The Img Software Set, by Paul Raveling <raveling@venera.isi.edu>,
  220. reads and writes its own image format, displays on an X11 screen, and does
  221. some image manipulations.  Version 1.3 is available via FTP on ftp.x.org as
  222. contrib/img_1.3.tar.Z, along with large collection of color images.
  223.  
  224.     The Utah RLE Toolkit is a conversion and manipulation package similar
  225. to PBMPLUS.  Available via FTP as cs.utah.edu:pub/urt-*,
  226. weedeater.math.yale.edu:pub/urt-*, and freebie.engin.umich.edu:pub/urt-*.
  227.  
  228.     Xim, The X Image Manipulator, by Philip Thompson, does essential
  229. interactive displaying, editing, filtering, and converting of images. There is
  230. a version in the X11R4 contrib area; but a more recent version (using R4 and
  231. Motif 1.1) is available from gis.mit.edu (18.80.1.118). Xim reads/writes gif,
  232. xwd, xbm, tiff, rle, xim, (writes level 2 eps) and other formats and also has
  233. a library and command-line utilities for building your own applications.
  234.  
  235.     ImageMagick by cristy@dupont.com is an X11 package for display and
  236. interactive manipulation of images.  Includes tools for image conversion,
  237. annotation, compositing, animation, and creating montages.  ImageMagick can
  238. read and write many of the more popular image formats (JPEG, TIFF, PNM,
  239. Postscript, ...).  Available via FTP from ftp.x.org as
  240. contrib/ImageMagick2.3.6.tar.Z. [1/94]
  241.  
  242.     xtiff is a tool for viewing a TIFF file in an X window.  It was
  243. written to handle as many different kinds of TIFF files as possible while
  244. remaining simple, portable and efficient.  xtiff illustrates some common
  245. problems with building pixmaps and using different visual classes.  It is
  246. distributed as part of Sam Leffler's libtiff package and it is also available
  247. on ftp.x.org and comp.sources.x.  [dbs@decwrl.dec.com,10/90] xtiff 2.0 was
  248. announced in 4/91; it includes Xlib and Xt versions.
  249.  
  250.     A version of Lee Iverson's (leei@McRCIM.McGill.EDU) image-viewing tool
  251. is available as contrib/vimage-0.9.3.tar.Z on ftp.x.org. The package also
  252. includes an ImageViewPort widget and a FileDialog widget.  [12/91;5/92]
  253.  
  254.     The Andrew User Interface System (version 5.2 and later) provides an
  255. image inset which can view many image formats.  Like all Andrew insets, an
  256. image can be incorporated in a a document or sent in email via the MIME
  257. standard. The following formats can be read:  Sunraster, GIF, Xbitmap,  TIFF,
  258. Xpixmap, JPEG, PBM, XWD.
  259.  
  260.     The LUG (Libreria de Utilidades Graficas) is a library of subroutines
  261. offering several routines for the manipulation of images in several different
  262. formats. The distribution includes viewers for several different platforms. The
  263. distribution is on telva.ccu.uniovi.es (156.35.31.31): 
  264. /uniovi/mathdept/src/liblug-1.0.1.tar.gz.
  265.  
  266. [some material from Larry Carroll (larryc@poe.jpl.nasa.gov), 5/91]
  267.  
  268. ----------------------------------------------------------------------
  269. Subject:  25)  Where can I get an X-based 3-D object viewer?
  270.  
  271.     xmgf by Paul Hoad (P.Hoad@ee.surrey.ac.uk) is an interactive tool for 
  272. viewing 2D and 3D objects typically in gf/OFF/NFF/IGRIP/MINICAD/SLA/DXF format
  273. Sources are on ftp.x.org.  Version 1.9.1 became available 12/93.
  274.  
  275.     x3d is a V.Fast 3D Object viewer for X it needs no special hardware or
  276. or widget libraries other that X and is optimized for speed.
  277.  
  278.     XGobi can be used to to view such data.
  279.     
  280.     VOGLE can be used to to view such data.
  281.  
  282. ----------------------------------------------------------------------
  283. Subject:  26)  How can I change the titlebar of my xterm window?
  284.  
  285.     The solution involves sending an escape sequence to xterm which will
  286. cause it to update the property which the window manager relies upon for the
  287. string which appears in the window titlebar.
  288.     A solution is as easy as typing this in an xterm running a shell:
  289.         echo "ESC]2;TEXT^G"
  290. where ESC is the escape key, TEXT is the string you wish to have displayed,
  291. and ^G is a Control-G (the BEL character). Note that the semi-colon is
  292. demanded by more recent versions of xterm. (Some shells and editors need an
  293. escape character, typically ^V, before accepting control characters literally.)
  294.  
  295.     Here is a more complicated csh alias which changes the titlebar to the
  296. current working directory when you change directories:
  297.         alias newcd 'cd \!*; echo -n ESC]2\;$cwd^G'
  298. (for other shells e.g. ksh you will need to write a function for cd to print
  299. this value).
  300.  
  301.     The digit '2' in these strings indicates to xterm that it should
  302. change only the title of the window; to change both the title and the name
  303. used in the icon, use the digit '0' instead, and use '1' to change only the
  304. icon name.
  305.  
  306.     Note: another way to do this, which prevents an incorrect display of
  307. the local directory if a modified `cd` is used in a subshell, is to wrap the
  308. escape sequences into the PS1 prompt itself.
  309.  
  310. ----------------------------------------------------------------------
  311. Subject:  27)  Where can I find the xterm control sequences?
  312.  
  313. The best source of such information is in your R5 sources in the file
  314. ctlseqs.ms; a PostScript version is in mit/hardcopy/clients/ctlseqs.PS.Z.
  315.  
  316. O'Reilly's Volume 3, the X User's Guide, includes an R5 version of the control
  317. sequences; the standard volume will be available 3/93, and a Motif version of
  318. the book is available now. The current (R4) guide includes an outdated version
  319. of the control sequences. [1/93]
  320.  
  321. Other good sources of information include the R4 version of that document and
  322. also the file in the R4 sources called mit/clients/xterm/ctlseq2.txt, a
  323. compilation put together by Skip Montanaro (GE CR&D) listing the VT100
  324. sequences. It dates from R3 but is fairly accurate.  A hardcopy version was
  325. published in the December 1989 XNextEvent (the XUG newsletter).
  326.  
  327. In a pinch, a VT100 manual will do.
  328.  
  329. [last updated 10/91]
  330.  
  331. ----------------------------------------------------------------------
  332. Subject:  28)  How can I use characters above ASCII 127 in xterm ?
  333.  
  334.     In order to use special characters such as the o-umlaut, you need to
  335. "stty pass8" but also to use a charcell ISO8859 font, such as
  336.     XTerm*font:     -*-*-medium-r-normal-*-*-130-*-*-c-*-iso8859-1
  337.     XTerm*boldfont: -*-*-bold-r-normal-*-*-130-*-*-c-*-iso8859-1 [The
  338. family is intentionally unspecified in this example.]
  339.  
  340. In addition, you may want to set this in your shell:
  341.     setenv LC_CTYPE iso_8859_1
  342.  
  343.     For a given character above 127, you can determine the key to use with
  344. the Alt modifier by finding the equivalent character below 127 (try using `man
  345. ascii`). For example, o-umlaut (v) is Alt-v and the section character (') is
  346. Alt-'.
  347.  
  348. [thanks to Greg Holmberg (greg%thirdi@uunet.uu.net) and Stephen Gildea
  349. (gildea@x.org); 6/92]
  350.  
  351. ----------------------------------------------------------------------
  352. Subject:  29)  Why are my xterm menus so small (sic) ?
  353.  
  354.     You are probably setting the geometry small accidentally. If you give
  355. a resource specification like this:
  356.         xterm*geometry: 80x24
  357. then you are asking for all widgets under xterm to have their geometry set to
  358. 80x24. For the main window, this is OK, as it uses characters for its size.
  359. But its popup menus don't; they are in pixels and show up small. To set only
  360. the terminal widget to have the specified geometry, name it explicitly:
  361.         xterm*VT100.geometry: 80x24
  362.  
  363. ----------------------------------------------------------------------
  364. Subject:  30)  How can I print the current X selection?
  365.  
  366.     You could paste it into an xterm after executing the lpr command.
  367. However, a program by Richard Hesketh (rlh2@ukc.ac.uk) specifically for
  368. manipulating the selection will help; e.g.
  369.     % xselection PRIMARY | lpr 
  370. finds the primary selection and prints it.
  371.     This command can be placed in a window-manager menu or in
  372. shell-scripts.  xselection also permits the setting of the selection and other
  373. properties. A version is on ftp.x.org.
  374.     Also available is ria.ccs.uwo.ca:pub/xget_selection.tar.Z, which can
  375. be adapted to do this.
  376.  
  377. ----------------------------------------------------------------------
  378. Subject:  31)  How does Xt use environment variables in loading resources?
  379.  
  380.     You can use several environment variables to control how resources are
  381. loaded for your Xt-based programs -- XFILESEARCHPATH, XUSERFILESEARCHPATH, and
  382. XAPPLRESDIR.  These environment variables control where Xt looks for
  383. application-defaults files as an application is initializing.  Xt loads at
  384. most one app-defaults file from the path defined in XFILESEARCHPATH and
  385. another from the path defined in XUSERFILESEARCHPATH.
  386.  
  387.     XAPPLRESDIR existed in R3 and before.  As of R4, the Xt developers
  388. added the more sophisticated *SEARCHPATH mechanism, but left XAPPLRESDIR in
  389. place to avoid breaking existing software.
  390.  
  391.     Set XFILESEARCHPATH if software is installed on your system in such a
  392. way that app-defaults files appear in several different directory
  393. hierarchies.  Suppose, for example, that you are running Sun's Open Windows,
  394. and you also have some R4 X applications installed in
  395. /usr/lib/X11/app-defaults. You could set a value like this for
  396. XFILESEARCHPATH, and it would cause Xt to look up app-defaults files in both
  397. /usr/lib/X11 and /usr/openwin/lib (or wherever your OPENWINHOME is located):
  398.     setenv XFILESEARCHPATH /usr/lib/X11/%T/%N:$OPENWINHOME/lib/%T/%N
  399.  
  400. The value of this environment variable is a colon-separated list of
  401. pathnames.  The pathnames contain replacement characters as follows (see
  402. XtResolvePathname()):
  403.  
  404.     %N      The value of the filename parameter, or the
  405.         application's class name.  
  406.     %T      The value of the file "type".  In this case, the
  407.         literal string "app-defaults" 
  408.     %C      customization resource (R5 only) 
  409.     %S      Suffix.  None for app-defaults.  
  410.     %L      Language, locale, and codeset (e.g. "ja_JP.EUC") 
  411.     %l      Language part of %L (e.g. "ja") 
  412.     %t      The territory part of the display's language string 
  413.     %c      The codeset part of the display's language string
  414.  
  415.     Let's take apart the example.  Suppose the application's class name is
  416. "Myterm". Also, suppose Open Windows is installed in /usr/openwin.
  417. (Notice the example omits locale-specific lookup.)
  418.     /usr/lib/X11/%T/%N        means /usr/lib/X11/app-defaults/Myterm
  419.     $OPENWINHOME/lib/%T/%N    means /usr/openwin/lib/app-defaults/Myterm
  420.  
  421.     As the application initializes, Xt tries to open both of the above
  422. app-defaults files, in the order shown.  As soon as it finds one, it reads it
  423. and uses it, and stops looking for others.  The effect of this path is to
  424. search first in /usr/lib/X11, then in /usr/openwin.
  425.  
  426.     Let's consider another example. This time, let's set
  427. XUSERFILESEARCHPATH so it looks for the file Myterm.ad in the current working
  428. directory, then for Myterm in the directory ~/app-defaults.
  429.     setenv XUSERFILESEARCHPATH ./%N.ad:$HOME/app-defaults/%N
  430.  
  431.     The first path in the list expands to ./Myterm.ad.  The second expands
  432. to $HOME/app-defaults/Myterm.  This is a convenient setting for debugging
  433. because it follows the Imake convention of naming the app-defaults file
  434. Myterm.ad in the application's source directory, so you can run the
  435. application from the directory in which you are working and still have the
  436. resources loaded properly.  NOTE: when looking for app-default files with
  437. XUSERFILESEARCHPATH, for some bizarre reason, neither the type nor file suffix
  438. is defined so %T and %S are useless.
  439.  
  440.     With R5, there's another twist.  You may specify a customization
  441. resource value.  For example, you might run the "myterm" application like
  442. this:
  443.     myterm -xrm "*customization: -color"
  444.  
  445.     If one of your pathname specifications had the value
  446. "/usr/lib/X11/%T/%N%C" then the expanded pathname would be
  447. "/usr/lib/X11/app-defaults/Myterm-color" because the %C substitution character
  448. takes on the value of the customization resource.
  449.  
  450.     The default XFILESEARCHPATH, compiled into Xt, is:
  451.         /usr/lib/X11/%L/%T/%N%C:\  (R5) /usr/lib/X11/%l/%T/%N%C:\ (R5)
  452.         /usr/lib/X11/%T/%N%C:\     (R5) /usr/lib/X11/%L/%T/%N:\
  453.         /usr/lib/X11/%l/%T/%N:\ /usr/lib/X11/%T/%N
  454.  
  455.     (Note: some sites replace /usr/lib/X11 with a ProjectRoot in this
  456. batch of default settings.)
  457.  
  458.     The default XUSERFILESEARCHPATH, also compiled into Xt, is
  459.         <root>/%L/%N%C:\  (R5) <root>/%l/%N%C:\  (R5)
  460.         <root>/%N%C:\     (R5) <root>/%L/%N:\ <root>/%l/%N:\
  461.         <root>/%N:
  462.  
  463.     <root> is either the value of XAPPLRESDIR or the user's home directory
  464. if XAPPLRESDIR is not set.  If you set XUSERFILESEARCHPATH to some value other 
  465. than the default, Xt ignores XAPPLRESDIR altogether.
  466.  
  467.     Notice that the quick and dirty way of making your application find
  468. your app-defaults file in your current working directory is to set XAPPLRESDIR
  469. to ".", a single dot.  In R3, all this machinery worked differently; for R3
  470. compatibilty, many people set their XAPPLRESDIR value to "./", a dot followed
  471. by a slash.
  472.  
  473. [Thanks to Oliver Jones (oj@world.std.com); 2/93.]
  474.  
  475. ----------------------------------------------------------------------
  476. Subject:  32)  How to I have xdm put a picture behind the log-in window?
  477.  
  478. R5 users can specify the "setup" script that xdm runs by changing the entry
  479. in the xdm-config file (usually in /usr/lib/X11/xdm) to name a different 
  480. script; the sample script distributed with X11R5 simply runs xconsole.
  481.  
  482. Earlier versions of the xdm client could be spoofed by in changing xdm's xrdb
  483. resource in the xdm-config file to run a program to change the background
  484. before loading the resources; for example, your /usr/lib/X11/xdm/xdm-config
  485. file may add the line
  486.     DisplayManager.0.authorize: false 
  487. to permit unrestricted access to the display before log-in (beware!) and also
  488.     DisplayManager*xrdb:    /usr/lib/X11/xdm/new.xrdb 
  489. where that file does something (for all connections) along the lines of:
  490.     #!/bin/sh 
  491.     #comes in with arguments: -display :0 -load /usr/lib/X11/xdm/Xresources
  492.     /usr/bin/X11/xsetroot -display $2 -bitmap /usr/lib/X11/xdm/new.bitmap 
  493.     /usr/bin/X11/xrdb $* 
  494. Substitute xloadimage or xv for xsetroot, to taste.  Note that this is a
  495. general hack that can be used to invoke a console window or any other client.
  496.  
  497. [Thanks to Jay Bourland (jayb@cauchy.stanford.edu), 9/91]
  498.  
  499. ----------------------------------------------------------------------
  500. Subject:  33)  Why isn't my PATH set when xdm runs my .xsession file?
  501.  
  502.     When xdm runs your .xsession it doesn't source your .cshrc or .login
  503. files. You can set the path explicitly as you normally could for any SH
  504. script; or you can place all environment-setting statements in a separate file
  505. and source it from both the .xsession file and your shell configuration file;
  506. or, if you set your PATH in your .cshrc file, the normal place, you can make
  507. your .xsession have PATH set simply by making it a csh script, i.e. by starting
  508. your .xsession file off with "#!/bin/csh".
  509.     If this doesn't work, also try starting off with:
  510.     #!/bin/sh # Reset path:  PATH=`csh -c 'echo $PATH'` ; export PATH
  511.  
  512. ----------------------------------------------------------------------
  513. Subject:  34)  How do I keep my $DISPLAY when I rlogin to another machine?
  514.  
  515.     There are several ways to avoid having to do a "setenv DISPLAY ..."
  516. whenever you log in to another networked UNIX machine running X.
  517.     A trivial solution, if your account is cross-mounted on both machines,
  518. is to have your .xsession write your DISPLAY variable to a file, and then in
  519. your login dot-files to check for the existence of that that file and use its
  520. contents as your DISPLAY. [Thanks to joachim.fricker@zh014.ubs.ubs.ch.]
  521.     One solution is to use the clients/xrsh on the R5 contrib tape.  It 
  522. includes xrsh, a script to start an X application on remote machine, and
  523. xrlogin, a script to start a local xterm running rlogin to a remote machine.
  524. A more recent version is on export in xrsh-5.4.shar.
  525.     One solution is to use the xrlogin program from der Mouse
  526. (mouse@larry.mcrcim.mcgill.edu). You can ftp caveat-emptor versions from
  527. 132.206.1.1, in X/xrlogin.c and X/xrlogind.c. The program packages up $TERM and
  528. $DISPLAY into a single string, which is stuffed into $TERM.  rlogin then 
  529. propagates $TERM normally; your .cshrc on the remote machine should contain
  530.         eval `xrlogind`
  531. where xrlogind is a program that checks $TERM and if it is of the special 
  532. format it recognizes, unpacks it and spits out setenv and unsetenv commands to 
  533. recreate the environment variables. [11/90]
  534.  
  535.     In addition, if all you need to do is start a remote X process on 
  536. another host, and you find
  537.         rsh <HOST> -n /usr/bin/X11/xterm -display $DISPLAY 
  538. too simple (DISPLAY must have your real hostname), then this version of xrsh 
  539. can be used to start up remote X processes. The equivalent usage would be 
  540.         xrsh <HOST> xterm
  541.  
  542.   #! /bin/sh
  543.   # start an X11 process on another host
  544.   # Date: 8 Dec 88 06:29:34 GMT
  545.   # From: Chris Torek <chris@mimsy.umd.edu>
  546.   # rsh $host -n "setenv DISPLAY $DISPLAY; exec $@ </dev/null >&/dev/null"
  547.   #
  548.   # An improved version:
  549.   # rXcmd (suggested by John Robinson, jr@bbn.com)
  550.   #       (generalized for sh,ksh by Keith Boyer, keith@cis.ohio-state.edu)
  551.   #
  552.   # but they put the rcmd in ()'s which left zombies again.  This
  553.   # script combines the best of both.
  554.   
  555.   case $# in
  556.   [01])  echo "Usage: $0 host x-cmd [args...]";;
  557.   *)
  558.       case $SHELL in
  559.       *csh*)  host="$1"; shift
  560.           xhost "$host" > /dev/null
  561.           rsh "$host" -n \
  562.               "setenv TERM xterm; setenv DISPLAY `hostname`:0; \
  563.               exec $* </dev/null >& /dev/null" &
  564.           ;;
  565.       *sh)
  566.           host="$1"; shift
  567.           xhost "$host" > /dev/null
  568.           rsh "$host" -n \
  569.               "TERM=xterm export TERM; \
  570.               DISPLAY=`hostname`:0 export DISPLAY; \
  571.               LD_LIBRARY_PATH=/usr/X11/lib export LD_LIBRARY_PATH; \
  572.               PATH=\$PATH:/usr/X11/bin:/usr/bin/X11:/usr/local/bin; \
  573.             export PATH; \
  574.               exec $* < /dev/null > /dev/null 2>&1" &
  575.           ;;
  576.       esac
  577.       ;;
  578.   esac
  579.  
  580. ----------------------------------------------------------------------
  581. Subject:  35)! How can I design my own font?
  582.  
  583.     One way is to use the "bitmap" client or some other bitmap-editor
  584. (e.g.  Sun's icon-editor tool, post-processed with pbmplus) to design the
  585. individual characters and then to do some large amount of post-processing to
  586. concatenate them into the BDF format. See Ollie Jones's article in the
  587. November 91 X Journal for more information.
  588.  
  589.     The R3 contrib/ area (in fonts/utils/ and in clients/xtroff) contained
  590. a number of useful utilities, including some to convert between BDF font
  591. format and a simple character format which can be edited with any text
  592. editor.
  593.  
  594.     An easier way is to use the "xfed" client to modify an existing font;
  595. a version is on the R4 or R5 X11R5 contrib tape in contrib/clients/xfed. Xfed
  596. was last seen on ftp.Informatik.Uni-Dortmund.DE [129.217.64.63], possibly as
  597. file /pub/windows/X/Diverse-X11-Sourcen/xfed.tar.Z. It can produce BDF-format
  598. fonts which can be compiled for a variety of X servers.
  599.  
  600.     The xfedor client from Group Bull permits creation of bitmaps,
  601. cursors, XPM1 pixmaps, and fonts. Binaries for common machines are on
  602. avahi.inria.fr in /pub; in addition, the sources (an old Xlib implementation)
  603. have been placed [5/91] in ftp.x.org:/contrib.
  604.  
  605.     If you are a MetaFont user you can use "mftobdf" from the SeeTeX
  606. distribution to convert PK, GF, and PXL fonts to BDF format; the distribution
  607. is on ftp.cs.colorado.edu and on ftp.x.org.
  608.     The GNU package fontutils-0.4.tar.Z on prep.ai.mit.edu includes xbfe,
  609. a font editor, and a number of utilities for massaging font formats.
  610.     The O'Reilly X Resource issue #2 contains an article on using these
  611. tools to modify a font.
  612.  
  613.     Fonts can be resized with Hiroto Kagotani's bdfresize; a new version
  614. is in ftp.cs.titech.ac.jp:/X11/contrib.  bdffont in the Andrew User Interface
  615. System (versions 5.2.2 and higher) lets you create a font or edit an existing
  616. one.
  617.  
  618. ----------------------------------------------------------------------
  619. Subject:  36)  Why does adding a font to the server not work (sic)?
  620.  
  621.     After you have built the font using your system's font-compiler,
  622. installed it in some directory, and run `mkfontdir` or your system's
  623. equivalent (e.g. bldfamily for OpenWindows) in that directory, be sure to use
  624. `xset +fp $dir` to add that full path-name to the server's font-path, *or* if
  625. the directory is already in the path, use `xset fp rehash` so that the new
  626. fonts in that directory are actually found; it is this last step that you're
  627. probably leaving out. (You can also use `xset q` to make sure that that
  628. directory is in the path.)
  629.     Sometimes your "xset +fp $dir" command fails with a BadValue error:
  630.         X Error of failed request:BadValue
  631.             (integer parameter out of range for operation) Major
  632.         opcode of failed request:  51 (X_SetFontPath)
  633.  
  634.     This means the X server cannot find or read your font directory, or
  635. that your directory does not look like a font directory to the server.  (The
  636. mention of an "integer parameter" in the message is spurious.)
  637.  
  638. -- Is the font directory you're specifying readable from the SERVER's file
  639.    system?  Remember, it's the server, not the client, which interprets your
  640.    font directory.  Trouble in this area is especially likely when you issue
  641.    an xset command with shell metacharacters in it (e.g. "xset +fp ~/myfonts")
  642.    and the server is an X terminal or managed by xdm.
  643.  
  644. -- Is the directory really a font directory?  If you're running the sample X
  645.    server (or most varieties of vendor servers) look in the directory for the
  646.    file "fonts.dir".  If you can't find that file, run mkfontdir(1). (If you're
  647.    running OpenWindows, look for the file "Families.list".  If you can't find
  648.    it, run bldfamily(1).)
  649.  
  650. -- If you're in a site where some people run X11Rn servers and others run a
  651.    proprietary server with nonstandard font formats (OpenWindows, for
  652.    example), make sure the font directory is right for the server you're
  653.    using.  Hint: if the directory contains .pcf and/or .snf files, it won't
  654.    work for Open Windows.  If the directory contains .ff and/or .fb files, it
  655.    won't work for X11Rn.
  656.  
  657. [thanks to der Mouse (mouse@larry.mcrcim.mcgill.edu) and to Oliver Jones
  658. (oj@pictel.com); 7/92 ]
  659.  
  660. ----------------------------------------------------------------------
  661. Subject:  37)  How do I convert a ".snf" font back to ".bdf" font?
  662.  
  663.     A tool called "snftobdf 1.6" can do this; it is available as:
  664.         ftp.x.org:contrib/snftobdf-1.6.tar.Z
  665.         crl.nmsu.edu:pub/misc/snftobdf-1.6.tar.Z
  666.  
  667. ----------------------------------------------------------------------
  668. Subject:  38)  What is a general method of getting a font in usable format?
  669.  
  670.     der Mouse's getbdf is one solution; it connects to a server and
  671. produces a .BDF file for any font the server is willing to let it.  It can be
  672. used as an anything-to-BDF converter, but requires access to a server that can
  673. understand the font file, thus is both more and less powerful than other tools
  674. such as snftobdf. getbdf is on 132.206.1.1 in X/getbdf.c or available via mail
  675. from mouse@larry.McRCIM.McGill.EDU. [5/91]
  676.     In addition, the R5 program "fstobdf" can produce bdf for any font
  677. that the R5 server has access to.
  678.  
  679. ----------------------------------------------------------------------
  680. Subject:  39)  How do I use DECwindows fonts on my non-DECwindows server?
  681.  
  682.     The DECwindows fonts typically don't exist on a non-DEC installation,
  683. but rewrite rules can be used to alias fonts used by DECwindows applications
  684. to standard X fonts of similar characteristics and size. Pick up the file
  685. contrib/DECwindows_on_X11R4_font.aliases from ftp.x.org; this file is for a
  686. sample R4 server.  It can also serve as a starting point for creating a
  687. similar aliases file for the Open Windows server or other servers which do not
  688. use the X Consortium's font scheme.
  689.  
  690. ----------------------------------------------------------------------
  691. Subject:  40)  How can I set backgroundPixmap in a defaults file? (What is XPM?) 
  692. I want to be able to do something like this:
  693.     xclock*backgroundPixmap:      /usr/include/X11/bitmaps/rootweave
  694.  
  695.     You can't do this. The backgroundPixmap resource is a pixmap of the
  696. same depth as the screen, not a bitmap (which is a pixmap of depth 1).
  697. Because of this, writing a generic String to Pixmap converter is impossible,
  698. since there is no accepted convention for a file format for pixmaps.
  699. Therefore, neither the X Toolkit or the Athena widget set define a String to
  700. Pixmap converter; because there is no converter you cannot specify this value
  701. as a resource.  The Athena widget set does define a String to Bitmap converter
  702. for use in many of its widgets, however.  [courtesy Chris D.  Peterson (now
  703. kit@ics.com), 4/90]
  704.  
  705. However:
  706.     A specific converter which encapsulates much of the functionality of
  707. the xloadimage package by Jim Frost was posted 12/90 by Sebastian Wangnick
  708. (basti@unido.informatik.uni-dortmund.de); it permits loading of a number of
  709. image formats as a pixmap.
  710.  
  711.     The leading general-purpose format for pixmaps is the XPM format used
  712. by Groupe Bull in several of its programs, including the GWM window manager,
  713. by AT&T in its olpixmap editor, and by ICS in its interface builder. XPM
  714. distribution, available on ftp.x.org as contrib/xpm.tar.Z, includes read/write
  715. routines which can easily be adapted to converters by new widgets which want
  716. to allow specification of pixmap resources in the above manner.  See
  717. information on the xpm-talk mailing list above. XPM 3.2g was announced in
  718. 4/93 and is available from ftp.x.org and avahi.inria.fr; an older version is
  719. on the R5 contrib tape. Version 3.3 became available 12/93. [A set of XPM
  720. icons collected by Anthony Thyssen (anthony@kurango.cit.gu.edu.au) is on
  721. ftp.x.org in contrib/AIcons; the hobbes-icon-xpm3 collection of XPM icons is
  722. on hobbes.nmsu.edu./]
  723.  
  724. ----------------------------------------------------------------------
  725. Subject:  41)  Why can't I override translations? Only the first item works. (sic)
  726.  
  727.     You probably have an extra space after the specification of the first 
  728. item, like this:
  729.     basic*text.translations:  #override \
  730.     Ctrl<Key>a:    beginning-of-line() \n\     
  731.     Ctrl<Key>e:    end-of-line()
  732.                           ^ extra space
  733. The newline after that space is ending the translation definition.
  734. [Thanks to Timothy J. Horton, 5/91]
  735.  
  736. ----------------------------------------------------------------------
  737. Subject:  42)  How can I have a clock show different timezones?
  738.  
  739.     One solution is xchron, in Volume 6 of comp.sources.x, which can show
  740. the time for timezones other than the local one.
  741.     sunclock on ftp.x.org displays a world map with sun/dark areas and
  742. local and UTC time.
  743.     The OpenWindows clock has a TimeZone property.  Modifications to the
  744.     Xaw clock widget to support hour and minute offsets were posted by
  745. David Herron (david@twg.com).
  746.     A patch for the clock coming with the Xaw3D widgets introduces
  747. resources hourOffset, minuteOffset, gmt; it can be found at
  748. ftp.wu-wien.ac.at:pub/src/X11/wafe/xaw3d.Clock.patch.
  749.  
  750.     Alternatively, you can probably set the timezone in the shell from
  751. which you invoke the xclock or oclock, or use a script similar to this:
  752.     #!/bin/sh 
  753.     TZ=PST8PDT xclock -name "Burnt" 2> /dev/null &
  754.     TZ=EST5EDT xclock -name "Frozen" 2> /dev/null &
  755.  
  756. ----------------------------------------------------------------------
  757. Subject:  43)  I have xmh, but it doesn't work. Where can I get MH?
  758.  
  759. The xmh mail-reader requires the Rand MH mail/message handling system, which
  760. is not part of the UNIX software distribution for many machines.  A list of
  761. various ftp, uucp, e-mail and US-mail sites for both xmh and MH is given in
  762. the monthly MH FAQ; one source is ics.uci.edu.
  763.  
  764. ----------------------------------------------------------------------
  765. Subject:  44)  Why am I suddenly unable to connect to my Sun X server?  
  766. After a seemingly random amount of time after the X server has been started,
  767. no other clients are able to connect to it.
  768.  
  769.     The default cron cleanup jobs supplied by Sun (for 4.0.3, at least)
  770. delete "old" (unreferenced) files from /tmp -- including /tmp/.X11-unix, which
  771. contains the socket descriptor used by X. The solution is to add "!  -type s"
  772. to the find exclusion in the cron job.  [10/90]
  773.  
  774. ----------------------------------------------------------------------
  775. Subject:  45)  Why don't the R5 PEX demos work on my mono screen?
  776.  
  777. The R5 sample server implementation works only on color screens, sorry.
  778.  
  779. ----------------------------------------------------------------------
  780. Subject:  46)  How do I get my Sun Type-[45] keyboard fully supported by Xsun?
  781.  
  782. Many users wants the Num Lock key to light the Num Lock LED and have the
  783. appropriate effect on the numeric keypad. The Xsun server as distributed by
  784. the Consortium doesn't do this but there are two different patches available.
  785.  
  786. The first patch is written by Jonathan Lemon and fixes the Num Lock related
  787. problems. It is available from ftp.x.org in the file
  788. contrib/Xsun-R5.numlock_patch.Z .
  789.  
  790. The second is written by Martin Forssen and fixes the Num Lock and Compose
  791. keys and adds support for the different national keyboard layouts for Type-4
  792. and Type-5 keyboards. This patch is available from ftp.x.org in
  793. contrib/sunkbd.930314.tar.Z or via email from maf@dtek.chalmers.se.
  794.  
  795. [thanks to Martin Forssen (maf@dtek.chalmers.se or maf@math.chalmers.se),
  796. 8/92]
  797.  
  798. A set of patches by William Bailey (dbgwab@arco.com) was posted to newsgroups
  799. 11/92 to provide support for the Type-5 keyboard.
  800.  
  801. (Note that use of xmodmap to map function and arrow keys can make the Type 5
  802. keyboard more useful without needing these patches.)
  803.  
  804. ----------------------------------------------------------------------
  805. Subject:  47)  How do I report bugs in X?
  806.  
  807.     Generally, report bugs you find to the organization that supplied you
  808. with the X Window System. If you received the R5 source distribution directly
  809. from the Consortium, please read the file mit/bug-report for instructions.
  810. [Look in mit/doc/bugs/bug-report in R4.]
  811.  
  812. [Thanks to Stephen Gildea <gildea@x.org>, 5/91; 12/91]
  813.  
  814. ----------------------------------------------------------------------
  815. Subject:  48)  Why do I get "Warning: Widget class version mismatch"?
  816.  
  817.     This error, which typically goes on to say, "widget 11004 vs.
  818. intrinsics 11003" indicates that the header files you included when building
  819. your program didn't match the header files that the Xt library you're linking
  820. against was built with; check your -I include path and -L link-path to be
  821. sure.
  822.     However, the problem also occurs when linking against a version of the
  823. X11R4 Xt library before patch 10; the version number was wrong.  Some Sun OW
  824. systems, in particular, were shipped with the flawed version of the library,
  825. and applications which link against the library typically give the warnings
  826. you have seen.
  827.  
  828. ----------------------------------------------------------------------
  829. Subject:  49)+  Why does my SPARC say "Mapping cg3c: No such device or address"?
  830.  
  831.     This problem comes up on Sun SPARC Classic machines.  There is no X
  832. Consortium fix for this problem, but the correction can be made to X11R5
  833. sources by editing the file "src/mit/server/ddx/sun/sunCG3C.c". Find the
  834. second buffer definition that looks like this:
  835.  
  836.    typedef struct cg3bc {
  837.    #ifdef sparc
  838.            u_char mpixel[128*1024];         /* bit-per-pixel memory */
  839.            u_char epixel[128*1024];         /* enable plane */
  840.    #endif
  841.            u_char cpixel[CG3B_HEIGHT][CG3B_WIDTH];   /* byte-per-pixel memory */
  842.    } CG3BC, CG3BCRec, *CG3BCPtr;
  843.  
  844. and change the instances of "128*1024" to "96*1024". Then recompile the
  845. X server.
  846.  
  847. [thanks to Russ Poffenberger (poffen@San-Jose.ate.slb.com)]
  848.  
  849. ----------------------------------------------------------------------
  850. Subject:  50)  Where can I find a dictionary server for xwebster?
  851.  
  852.     Webster's still owns the copyright to the on-line copies of Webster's
  853. Dictionary which are found at various (university) sites. After it became
  854. aware that these sites were then acting as servers for other sites running
  855. xwebster and gnuemacs-webster, it asked that server sites close off external
  856. access.
  857.     [The NeXT machine apparently is also licensed to have the dictionary.
  858.     A Webster daemon for NeXT machines is available from
  859. iuvax.cs.indiana.edu (129.79.254.192) in "pub/webster/NeXT-2.0".]
  860.     Unless you want to get a legal on-line copy yourself or can find a
  861. site which can grant you access, you are probably out of luck.
  862.  
  863.     However, if you are a legitimate site, you'll want to pick up the
  864. latest xwebster, as-is on ftp.x.org:contrib/xwebster.tar.Z [10/91]; the file
  865. xwebster.README includes discussions of the availability, illegality, and
  866. non-availability of dictionary servers.
  867.  
  868. [courtesy steve@UMIACS.UMD.EDU (Steve Miller) and mayer@hplabs.hp.com (Niels
  869. Mayer) 11/90]
  870.  
  871. ----------------------------------------------------------------------
  872.  
  873. David B. Lewis                     faq%craft@uunet.uu.net
  874.  
  875.         "Just the FAQs, ma'am." -- Joe Friday 
  876. -- 
  877. David B. Lewis        Temporarily at but not speaking for Visual, Inc.
  878. day: dbl@visual.com    evening: david%craft@uunet.uu.net
  879.